package network;

import com.mongodb.MongoClient;
import data.DatabaseClient;

public class DirectConnection extends ConnectionBase {
    private DirectConnectionConfig config;

    public void init(DirectConnectionConfig config) {
        this.config = config;
    }

    @Override
    public DatabaseClient connect() {
        DatabaseClient databaseClient = new DatabaseClient(config.getDatabaseName(), config.getHost(), config.getPort().toString());
        MongoClient mongoClient = new MongoClient(config.getHost(), config.getPort());
        databaseClient.setClient(mongoClient);
        return databaseClient;
    }

    @Override
    public void close() {

    }
}
